interface Response<T = any> {
  code: number
  data: T
  message: string
}

export function success<T = any>(data: T, message = '操作成功'): Response<T> {
  return {
    code: 200,
    data,
    message
  }
}

export function error(code = 500, message = '操作失败'): Response<null> {
  return {
    code,
    data: null,
    message
  }
}
